package d4_com.itheima.Math;

public class Test {
    public static void main(String[] args) {
        System.out.println(Math.abs(-12));//12
        System.out.println(Math.abs(123));//123
        System.out.println(Math.abs(-3.14));//3.14
        //向上取整
        System.out.println(Math.ceil(4.0000001));//5.0
        System.out.println(Math.ceil(4.0));//4.0
        //向下取整
        System.out.println(Math.floor(4.999999));//4.0
        System.out.println(Math.floor(4.0));// 4.0
        //四舍五入
        System.out.println(Math.round(3.4999));//3
        System.out.println(Math.round(3.50001));//4
        //较大值 较小值
        System.out.println(Math.max(10,20));//20
        System.out.println(Math.min(10,20));//10
        //取次方
        System.out.println(Math.pow(2,3));//2的3次方
        System.out.println(Math.pow(3,2));//3的2次方
        //取随机数
        System.out.println(Math.random());//取随机数[0.0，1.0)(包前不包后)
    }
}
